<template>
	<section class="scholl border-box" v-if='express_list'>
		<div class="express-contain">
			<div class="layout border-b20 pt30rem pr30rem pb30rem pl30rem">
				<!-- <img :src="img_url + express_list.img" alt="物流" class="circle mr30rem"> -->
				<img style="width:5rem" src="../../../assets/member/avatar.png" alt="物流" class="circle mr30rem">
				<div class="flex_1">
					<p>
						快递公司：{{express_list.shipperCode}}
					</p>
					<p>
						运单号：{{express_list.express_no}}
					</p>
					<p>
						官方电话：{{express_list.phone}}
					</p>
				</div>
			</div>	
			<ul class="pl30rem pr30rem">
				<li v-for="(item, index) in express_list.trace" class="flex-left " :class="{ red: index == 0}">
					<div class="circle-list">
						<p class="line" 	 :class="{lactive: index == 0}"></p>
						<span class="circle" :class="{cactive: index == 0}"></span>
						<p class="line" :class="{lactive: express_list.trace.length-1==index}"></p>
					</div>
					<div class="border-b pt30rem full-width">
						<p>
							{{item.AcceptStation}}
						</p>
						<p>
							{{item.AcceptTime}}
						</p>
					</div>
				</li>
			</ul>						
		</div>			
	</section>
</template>

<script>
	import { getExpressMessage }  from '@/api/ordering';	
		
	export default
	{
		data()
		{
			return{
				uid: localStorage.getItem('uid'),
				order_id: this.$route.query.order_id,
				express_list: [],
				img_url: process.env.IMG_URL,
			}
		},
		methods:
		{
			loadData()
			{
				getExpressMessage(this.uid, this.order_id).then( res => {
					this.express_list = res.data;
				});
			}
		},
		created()
		{
			this.loadData();
		}
	}
	
</script>

<style lang="less">
	.express-contain{
		.lable{
			display: inline-block;
			width: 5rem;
		}
		.circle-list{
			display: inline-block;
			width: 5rem;
			height: 5rem;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			.line{
				width: 1px;
				height: 2.5rem;
				border-left: 1px solid #eee;
			}
			.lactive{
				border-left-color: white;
			}
			
			.circle{
				display: block;
				width: 5px;
				height: 5px;
				background-color: #eee;
				border-radius: 100%;
				margin-left: -1px;	
			}	
			.cactive{
				width: 10px !important;
				height: 10px !important;
				background-color: #51C467;
				border-radius: 100%;
			}		
			
		}
	}
	
</style>

